<script type="text/javascript" charset="utf-8" >

$(function(){
	
	var url_contact_us =  "<?=site_url(); ?>index.php";
	
	// Add blackbox
	$('.video_result .items div >a').each(function(index){
		
		// Each item add blackbox
		$(this).fancybox();
		
	});
	
	// Add even to paging link 's video div 
	$('.video_result .video_seach_paging >a').each(function(index){
		
		$(this).click(function(event){
			
			event.preventDefault();
			
			// Get href attribute 's anchor
			var local_url = $(this).attr('href');
						
			console.log(url_contact_us+'/'+local_url);			
	
			$(this).parents('.video_result').load(url_contact_us+'/'+local_url, function(){
				// Load videos div successfully !
			});
		
		});
		
	});
	
});

</script>
<?php if (count($videos) < 1) :?>
	<?=$videos_message;?>
<?php else : ?>	
<div class="items">
	<?php foreach ($videos as $item) : ?>
		<div><a href="<?=site_url().'index.php/home/video_detail/'.$item['product_id'].'/'.$item['id'];?>"><?=$item['name'];?></a></div>
	<?php endforeach; ?>
</div>
<?php endif; ?>
<div style="clear:both"></div>
<div class="video_seach_paging"><?=$videos_paging;?></div>
